package com.ithiema.edu.info.manager.domain;

import com.ithiema.edu.info.manager.utils.Utils;

public class Persion {
    private String id;
    private String name;
    private String sex;
    private String birthday;
    private int age;

    Utils utils = new Utils();

    public Persion() {
    }

    public Persion(String id, String name, String sex, String birthday) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.birthday = birthday;
        age = utils.getAge(birthday);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.age = utils.getAge(birthday);
        this.birthday = birthday;
    }

    public int getAge() {
        return age;
    }
}
